package example.result;

import example.constant.ResponseEnum;

import java.io.Serializable;

/**
 * 标准api接口输出
 * Created by zhouZiXong on 2017/8/23.
 */
public class Result implements Serializable{
    private String code;
    private String message;
    private Object data;

    public Result(ResponseEnum responseEnum){
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMessage();
    }

    public Result(Object data){
        this.data = data;
        this.code = ResponseEnum.SUCCESS.getCode();
        this.message = ResponseEnum.SUCCESS.getMessage();
    }

    public Result(String code, String message){
        this.code = code;
        this.message = message;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
